import {Link} from "react-router";
var Gods = React.createClass({
	render: function(){
		//console.log(this.props.data)
		return (
			<section>
				<Link href="" data-id={this.props.data.goods_id} to={"home/goods?goods_id="+this.props.data.goods_id}>
					<img src={this.props.data.goods_image} />
				</Link>
				<p>{this.props.data.goods_name}</p>
				<h3>{this.props.data.goods_promotion_price}</h3>
			</section>
		)
	}
})

var Goodlist = React.createClass({
	render: function(){
		//console.log(this.props.data.goods.item)
		var Obj = this.props.data.goods.item.map(function(data,index){
			 
			return <Gods data={data} key = {index}/>
		})
		return (
			<div className="home_goodlist">
			<h3><span></span>{this.props.data.goods.title}</h3>
				{Obj}
			</div>
		)
	}
})

export default React.createClass({
	render : function(){
		var Obj = this.props.data.map(function(data,index){
			return <Goodlist data={data} key = {index}/>
		})
		return (
			<div>
				{Obj}
			</div>
		)
	}
})
